package com.sc.nft.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dao.WorkCityServerAssessDetailLogDao;
import com.sc.nft.entity.dto.AssessLogAdminDetailsPageDTO;
import com.sc.nft.entity.dto.AssessLogAdminDetailsPageVO;
import com.sc.nft.entity.vo.WebApplicationRequirementResultVO;
import com.sc.nft.entity.vo.WebApplicationRequirementVO;
import com.sc.nft.entity.vo.WebApplicationRequirementWhereVO;
import com.sc.nft.service.WorkCityServerAssessDetailLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考核记录详情表(WorkCityServerAssessDetailLog)表服务实现类
 *
 * @author 王伟成
 * @since 2024-04-09 20:11:05
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class WorkCityServerAssessDetailLogServiceImpl implements WorkCityServerAssessDetailLogService {

    private final WorkCityServerAssessDetailLogDao workCityServerAssessDetailLogDao;

    @Override
    public Page<AssessLogAdminDetailsPageVO> assessDetailsPage(AssessLogAdminDetailsPageDTO assessLogAdminDetailsPageDTO) {
        return workCityServerAssessDetailLogDao.assessDetailsPage(assessLogAdminDetailsPageDTO);
    }

    @Override
    public WebApplicationRequirementResultVO assessDetailsResult(Long id) {
        String result = workCityServerAssessDetailLogDao.assessDetailsResult(id);
        WebApplicationRequirementResultVO webApplicationRequirementVO = JSONObject.parseObject(result, WebApplicationRequirementResultVO.class);
        return webApplicationRequirementVO;
    }
}
